package com.example.springbootmybatis05.controller;

import com.example.springbootmybatis05.mapper.UserMapper;
import com.example.springbootmybatis05.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 墨苍璃
 * @date 2022年01月13日20时35分
 */
@RestController
public class UserController {

    @Autowired
    UserMapper userMapper;


    /**
     * 查询全部user
     *
     * @return
     */
    @GetMapping("/getAll")
    public List<User> getDepartments() {
        return userMapper.getList();
    }
}
